import { createTextVNode } from '../vnode'
import {
    isUndef,
    isPrimitive,
    isDef,
    isFalse
} from '../../util/index.js'
export function normalizeChildren(children) {
    return isPrimitive(children)
    ? [createTextVNode(children)]
    : Array.isArray(children)
      ? normalizeArrayChildren(children)
      : undefined
}
function isTextNode (node) {
    return isDef(node) && isDef(node.text) && isFalse(node.isComment)
}
function normalizeArrayChildren(children, nestedIndex) {
    const res = []
    let i,c
    for (i = 0; i < children.length; i++) {
        c = children[i];
        if (isUndef(c) || typeof c === 'boolean') continue
        if (Array.isArray(c)) {

        } else if (isPrimitive(c)) {

        } else {
            res.push(c)
        }
    }
    return res
}